bash-completion: Remove `admin` completions
authorColin Walters <walters@verbum.org>
Mon, 26 Feb 2018 19:11:00 +0000 (14:11 -0500)
committerAtomic Bot <atomic-devel@projectatomic.io>
Tue, 27 Feb 2018 13:56:11 +0000 (13:56 +0000)
The `admin` commandline should be considered a demo; I just added
the `pin` command *mostly* so we could use it for unit tests, although
I can imagine other people using it.

But maintaining completions is a lot of overhead right now, let's not
do it for `admin`.

The other command line options that operate on repos we will definitely maintain
since they're used in releng contexts.

Closes: #1468
Approved by: jlebon

16 files changed:
bash/ostree
src/ostree/ot-admin-builtin-cleanup.c
src/ostree/ot-admin-builtin-deploy.c
src/ostree/ot-admin-builtin-diff.c
src/ostree/ot-admin-builtin-init-fs.c
src/ostree/ot-admin-builtin-os-init.c
src/ostree/ot-admin-builtin-pin.c
src/ostree/ot-admin-builtin-set-origin.c
src/ostree/ot-admin-builtin-status.c
src/ostree/ot-admin-builtin-switch.c
src/ostree/ot-admin-builtin-undeploy.c
src/ostree/ot-admin-builtin-unlock.c
src/ostree/ot-admin-builtin-upgrade.c
src/ostree/ot-admin-instutil-builtin-grub2-generate.c
src/ostree/ot-admin-instutil-builtin-selinux-ensure-labeled.c
src/ostree/ot-admin-instutil-builtin-set-kargs.c

index edef6cff87e4c743e8870923e112927b59d2f48d..218e4254f960a42801d351c5ea9cf2a563d353c9 100644 (file)
@@ -180,503 +180,6 @@ _ostree_ostree() {
     return 0
 }
 
-_ostree_admin_cleanup() {
-    local boolean_options="
-        $main_boolean_options
-    "
-
-    local options_with_args="
-        --sysroot
-    "
-
-    local options_with_args_glob=$( __ostree_to_extglob "$options_with_args" )
-
-    case "$prev" in
-        --sysroot)
-            __ostree_compreply_dirs_only
-            return 0
-            ;;
-        $options_with_args_glob )
-            return 0
-            ;;
-    esac
-
-    case "$cur" in
-        -*)
-            local all_options="$boolean_options $options_with_args"
-            __ostree_compreply_all_options
-            ;;
-    esac
-
-    return 0
-}
-
-_ostree_admin_config_diff() {
-    local boolean_options="
-        $main_boolean_options
-    "
-
-    local options_with_args="
-        --os
-        --sysroot
-    "
-
-    local options_with_args_glob=$( __ostree_to_extglob "$options_with_args" )
-
-    case "$prev" in
-        --os)
-            __ostree_compreply_oses
-            return 0
-            ;;
-        --sysroot)
-            __ostree_compreply_dirs_only
-            return 0
-            ;;
-        $options_with_args_glob )
-            return 0
-            ;;
-    esac
-
-    case "$cur" in
-        -*)
-            local all_options="$boolean_options $options_with_args"
-            __ostree_compreply_all_options
-            ;;
-    esac
-
-    return 0
-}
-
-_ostree_admin_deploy() {
-    local boolean_options="
-        $main_boolean_options
-        --retain
-        --retain-pending
-        --retain-rollback
-        --not-as-default
-        --karg-proc-cmdline
-    "
-
-    local options_with_args="
-        --karg
-        --karg-append
-        --origin-file
-        --os
-        --sysroot
-    "
-
-    local options_with_args_glob=$( __ostree_to_extglob "$options_with_args" )
-
-    case "$prev" in
-        --origin-file)
-            __ostree_compreply_all_files
-            return 0
-            ;;
-        --os)
-            __ostree_compreply_oses
-            return 0
-            ;;
-        --sysroot)
-            __ostree_compreply_dirs_only
-            return 0
-            ;;
-        $options_with_args_glob )
-            return 0
-            ;;
-    esac
-
-    case "$cur" in
-        -*)
-            local all_options="$boolean_options $options_with_args"
-            __ostree_compreply_all_options
-            ;;
-    esac
-
-    return 0
-}
-
-_ostree_admin_init_fs() {
-    local boolean_options="
-        $main_boolean_options
-    "
-
-    local options_with_args="
-        --sysroot
-    "
-
-    local options_with_args_glob=$( __ostree_to_extglob "$options_with_args" )
-
-    case "$prev" in
-        --sysroot)
-            __ostree_compreply_dirs_only
-            return 0
-            ;;
-        $options_with_args_glob )
-            return 0
-            ;;
-    esac
-
-    case "$cur" in
-        -*)
-            local all_options="$boolean_options $options_with_args"
-            __ostree_compreply_all_options
-            ;;
-    esac
-
-    return 0
-}
-
-_ostree_admin_instutil() {
-    local boolean_options="
-        $main_boolean_options
-    "
-
-    local options_with_args="
-        --sysroot
-    "
-
-    local options_with_args_glob=$( __ostree_to_extglob "$options_with_args" )
-
-    case "$prev" in
-        --sysroot)
-            __ostree_compreply_dirs_only
-            return 0
-            ;;
-        $options_with_args_glob )
-            return 0
-            ;;
-    esac
-
-    case "$cur" in
-        -*)
-            local all_options="$boolean_options $options_with_args"
-            __ostree_compreply_all_options
-            ;;
-        *)
-            local argpos=$( __ostree_pos_first_nonflag $( __ostree_to_alternatives "$options_with_args" ) )
-            if [ $cword -eq $argpos ]; then
-                local instutil_commands="
-                    grub2-generate
-                    selinux-ensure-labeled
-                    set-kargs
-                "
-                COMPREPLY=( $( compgen -W "$instutil_commands" -- "$cur" ) )
-            fi
-            ;;
-    esac
-
-    return 0
-}
-
-_ostree_admin_os_init() {
-    local boolean_options="
-        $main_boolean_options
-    "
-
-    local options_with_args="
-        --sysroot
-    "
-
-    local options_with_args_glob=$( __ostree_to_extglob "$options_with_args" )
-
-    case "$prev" in
-        --sysroot)
-            __ostree_compreply_dirs_only
-            return 0
-            ;;
-        $options_with_args_glob )
-            return 0
-            ;;
-    esac
-
-    case "$cur" in
-        -*)
-            local all_options="$boolean_options $options_with_args"
-            __ostree_compreply_all_options
-            ;;
-    esac
-
-    return 0
-}
-
-_ostree_admin_pin() {
-    local boolean_options="
-        $main_boolean_options
-    "
-
-    local options_with_args="
-        --sysroot
-    "
-
-    local options_with_args_glob=$( __ostree_to_extglob "$options_with_args" )
-
-    case "$prev" in
-        --sysroot)
-            __ostree_compreply_dirs_only
-            return 0
-            ;;
-        $options_with_args_glob )
-            return 0
-            ;;
-    esac
-
-    case "$cur" in
-        -*)
-            local all_options="$boolean_options $options_with_args"
-            __ostree_compreply_all_options
-            ;;
-    esac
-
-    return 0
-}
-
-_ostree_admin_set_origin() {
-    local boolean_options="
-        $main_boolean_options
-    "
-
-    local options_with_args="
-        --index
-        --set -s
-        --sysroot
-    "
-
-    local options_with_args_glob=$( __ostree_to_extglob "$options_with_args" )
-
-    case "$prev" in
-        --sysroot)
-            __ostree_compreply_dirs_only
-            return 0
-            ;;
-        $options_with_args_glob )
-            return 0
-            ;;
-    esac
-
-    case "$cur" in
-        -*)
-            local all_options="$boolean_options $options_with_args"
-            __ostree_compreply_all_options
-            ;;
-        *)
-            local argpos=$( __ostree_pos_first_nonflag $( __ostree_to_alternatives "$options_with_args" ) )
-            if [ $cword -eq $argpos ]; then
-                __ostree_compreply_remotes
-            fi
-            ;;
-    esac
-
-    return 0
-}
-
-_ostree_admin_status() {
-    local boolean_options="
-        $main_boolean_options
-    "
-
-    local options_with_args="
-        --sysroot
-    "
-
-    local options_with_args_glob=$( __ostree_to_extglob "$options_with_args" )
-
-    case "$prev" in
-        --sysroot)
-            __ostree_compreply_dirs_only
-            return 0
-            ;;
-        $options_with_args_glob )
-            return 0
-            ;;
-    esac
-
-    case "$cur" in
-        -*)
-            local all_options="$boolean_options $options_with_args"
-            __ostree_compreply_all_options
-            ;;
-    esac
-
-    return 0
-}
-
-_ostree_admin_switch() {
-    local boolean_options="
-        $main_boolean_options
-    "
-
-    local options_with_args="
-        --os
-        --reboot -r
-        --sysroot
-    "
-
-    local options_with_args_glob=$( __ostree_to_extglob "$options_with_args" )
-
-    case "$prev" in
-        --os)
-            __ostree_compreply_oses
-            return 0
-            ;;
-        --sysroot)
-            __ostree_compreply_dirs_only
-            return 0
-            ;;
-        $options_with_args_glob )
-            return 0
-            ;;
-    esac
-
-    case "$cur" in
-        -*)
-            local all_options="$boolean_options $options_with_args"
-            __ostree_compreply_all_options
-            ;;
-        *)
-            local argpos=$( __ostree_pos_first_nonflag $( __ostree_to_alternatives "$options_with_args" ) )
-
-            if [ $cword -eq $argpos ]; then
-                __ostree_compreply_refs
-            fi
-    esac
-
-    return 0
-}
-
-_ostree_admin_undeploy() {
-    local boolean_options="
-        $main_boolean_options
-    "
-
-    local options_with_args="
-        --sysroot
-    "
-
-    local options_with_args_glob=$( __ostree_to_extglob "$options_with_args" )
-
-    case "$prev" in
-        --sysroot)
-            __ostree_compreply_dirs_only
-            return 0
-            ;;
-        $options_with_args_glob )
-            return 0
-            ;;
-    esac
-
-    case "$cur" in
-        -*)
-            local all_options="$boolean_options $options_with_args"
-            __ostree_compreply_all_options
-            ;;
-    esac
-
-    return 0
-}
-
-_ostree_admin_unlock() {
-    local boolean_options="
-        $main_boolean_options
-        --hotfix
-    "
-
-    local options_with_args="
-        --sysroot
-    "
-
-    local options_with_args_glob=$( __ostree_to_extglob "$options_with_args" )
-
-    case "$prev" in
-        --sysroot)
-            __ostree_compreply_dirs_only
-            return 0
-            ;;
-        $options_with_args_glob )
-            return 0
-            ;;
-    esac
-
-    case "$cur" in
-        -*)
-            local all_options="$boolean_options $options_with_args"
-            __ostree_compreply_all_options
-            ;;
-    esac
-
-    return 0
-}
-
-_ostree_admin_upgrade() {
-    local boolean_options="
-        $main_boolean_options
-        --allow-downgrade
-        --deploy-only
-        --pull-only
-        --reboot -r
-    "
-
-    local options_with_args="
-        --os
-        --override-commit
-        --sysroot
-    "
-
-    local options_with_args_glob=$( __ostree_to_extglob "$options_with_args" )
-
-    case "$prev" in
-        --override-commit)
-            __ostree_compreply_commits
-            return 0
-            ;;
-        --sysroot)
-            __ostree_compreply_dirs_only
-            return 0
-            ;;
-        $options_with_args_glob )
-            return 0
-            ;;
-    esac
-
-    case "$cur" in
-        -*)
-            local all_options="$boolean_options $options_with_args"
-            __ostree_compreply_all_options
-            ;;
-    esac
-
-    return 0
-}
-
-_ostree_admin() {
-    local subcommands="
-        cleanup
-        config-diff
-        deploy
-        init-fs
-        instutil
-        os-init
-        set-origin
-        status
-        switch
-        undeploy
-        unlock
-        upgrade
-    "
-
-    __ostree_subcommands "$subcommands" && return 0
-
-    case "$cur" in
-        -*)
-            COMPREPLY=( $( compgen -W "$main_boolean_options" -- "$cur" ) )
-            ;;
-        *)
-            COMPREPLY=( $( compgen -W "$subcommands" -- "$cur" ) )
-            ;;
-    esac
-
-    return 0
-}
-
 _ostree_cat() {
     local boolean_options="
         $main_boolean_options
index 4028931e0f253e38c682af34431351e8e586db42..a4753030a1082c05f1419815f639bd20a9e9dc35 100644 (file)
 
 #include <glib/gi18n.h>
 
-/* ATTENTION:
- * Please remember to update the bash-completion script (bash/ostree) and
- * man page (man/ostree-admin-cleanup.xml) when changing the option list.
- */
-
 static GOptionEntry options[] = {
   { NULL }
 };
index ee7f3ccf2b4539d6565ccb2a2302dc08e9fdf6e7..d9905212eed8cf1f7eee636afb79a5bcc4c7ee98 100644 (file)
@@ -45,11 +45,6 @@ static char *opt_osname;
 static char *opt_origin_path;
 static gboolean opt_kernel_arg_none;
 
-/* ATTENTION:
- * Please remember to update the bash-completion script (bash/ostree) and
- * man page (man/ostree-admin-deploy.xml) when changing the option list.
- */
-
 static GOptionEntry options[] = {
   { "os", 0, 0, G_OPTION_ARG_STRING, &opt_osname, "Use a different operating system root than the current one", "OSNAME" },
   { "origin-file", 0, 0, G_OPTION_ARG_FILENAME, &opt_origin_path, "Specify origin file", "FILENAME" },
index 6a44a72bcce4b606b9960432b912965f8a86df3b..2785588183fcfbe27a122335a7d970c33ff6be01 100644 (file)
 
 static char *opt_osname;
 
-/* ATTENTION:
- * Please remember to update the bash-completion script (bash/ostree) and
- * man page (man/ostree-admin-config-diff.xml) when changing the option list.
- */
-
 static GOptionEntry options[] = {
   { "os", 0, 0, G_OPTION_ARG_STRING, &opt_osname, "Use a different operating system root than the current one", "OSNAME" },
   { NULL }
index 70348402f962e3af8d99c5465c4cbf3a3c4c38ef..cca63a62bf340ac7802beb4327a16aa780d4d2cf 100644 (file)
 
 #include <glib/gi18n.h>
 
-/* ATTENTION:
- * Please remember to update the bash-completion script (bash/ostree) and
- * man page (man/ostree-admin-init-fs.xml) when changing the option list.
- */
-
 static GOptionEntry options[] = {
   { NULL }
 };
index 411e415e85eda17f6a8fbc9941cffab4bd1c3fdd..203f297beaaa7401376a58c6e5284dd62abc4420 100644 (file)
 
 #include <glib/gi18n.h>
 
-/* ATTENTION:
- * Please remember to update the bash-completion script (bash/ostree) and
- * man page (man/ostree-admin-os-init.xml) when changing the option list.
- */
-
 static GOptionEntry options[] = {
   { NULL }
 };
index e26ea926377b557307b6bf795b9eecef2e629b58..f110983b8857cb29a30313e59a146852a357dfa2 100644 (file)
 #include "ostree.h"
 #include "otutil.h"
 
-/* ATTENTION:
- * Please remember to update the bash-completion script (bash/ostree) and
- * man page (man/ostree-admin-pin.xml) when changing the option list.
- */
-
 static gboolean opt_unpin;
 
 static GOptionEntry options[] = {
index 77f14bf53be90e43b2bbd32412a9b8ba98710b13..07453a871aa6f682378cba16058c717a615bf3e3 100644 (file)
 static int opt_index = -1;
 static char **opt_set;
 
-/* ATTENTION:
- * Please remember to update the bash-completion script (bash/ostree) and
- * man page (man/ostree-admin-set-origin.xml) when changing the option list.
- */
-
 static GOptionEntry options[] = {
   { "set", 's', 0, G_OPTION_ARG_STRING_ARRAY, &opt_set, "Set config option KEY=VALUE for remote", "KEY=VALUE" },
   { "index", 0, 0, G_OPTION_ARG_INT, &opt_index, "Operate on the deployment INDEX, starting from zero", "INDEX" },
index 02991309441bafd2827b377306f8dbf8c5fa2aa5..a2e24ef34bcfdc0cd8bdca52401ac4231923c727 100644 (file)
 
 #include <glib/gi18n.h>
 
-/* ATTENTION:
- * Please remember to update the bash-completion script (bash/ostree) and
- * man page (man/ostree-admin-status.xml) when changing the option list.
- */
-
 static GOptionEntry options[] = {
   { NULL }
 };
index 7609b25a198a44a43282781456a5aefd9b7adee4..2f12ef1d7111d4c1b35dc0ead478dce5828b9d5e 100644 (file)
 static gboolean opt_reboot;
 static char *opt_osname;
 
-/* ATTENTION:
- * Please remember to update the bash-completion script (bash/ostree) and
- * man page (man/ostree-admin-switch.xml) when changing the option list.
- */
-
 static GOptionEntry options[] = {
   { "reboot", 'r', 0, G_OPTION_ARG_NONE, &opt_reboot, "Reboot after switching trees", NULL },
   { "os", 0, 0, G_OPTION_ARG_STRING, &opt_osname, "Use a different operating system root than the current one", "OSNAME" },
index 6f070524941e5112bb87ad82208d30fa638694ed..0a50dc0d906b0fc5b296e8ca7ba5481bd41731a0 100644 (file)
 #include "ostree.h"
 #include "otutil.h"
 
-/* ATTENTION:
- * Please remember to update the bash-completion script (bash/ostree) and
- * man page (man/ostree-admin-undeploy.xml) when changing the option list.
- */
-
 static GOptionEntry options[] = {
   { NULL }
 };
index 34ff08cd403cfa2183393669c6a1f6b1aade142c..f0efa44ab87fc9f2f96bdfea3d5f34dba17ea0cc 100644 (file)
 
 static gboolean opt_hotfix;
 
-/* ATTENTION:
- * Please remember to update the bash-completion script (bash/ostree) and
- * man page (man/ostree-admin-unlock.xml) when changing the option list.
- */
-
 static GOptionEntry options[] = {
   { "hotfix", 0, 0, G_OPTION_ARG_NONE, &opt_hotfix, "Retain changes across reboots", NULL },
   { NULL }
index 1b6a0253404b5a0431bd96197fa3072e3e88a2f6..eafe8bceb79ed6d5c54a83d159d3ed03137e4642 100644 (file)
@@ -40,11 +40,6 @@ static gboolean opt_deploy_only;
 static char *opt_osname;
 static char *opt_override_commit;
 
-/* ATTENTION:
- * Please remember to update the bash-completion script (bash/ostree) and
- * man page (man/ostree-admin-upgrade.xml) when changing the option list.
- */
-
 static GOptionEntry options[] = {
   { "os", 0, 0, G_OPTION_ARG_STRING, &opt_osname, "Use a different operating system root than the current one", "OSNAME" },
   { "reboot", 'r', 0, G_OPTION_ARG_NONE, &opt_reboot, "Reboot after a successful upgrade", NULL },
index df9d804ba30ac0e5794edef7804d030a7e0c90bf..3ab5c24517ee2fbf169a48b82b4544f013771765 100644 (file)
 
 #include "otutil.h"
 
-/* ATTENTION:
- * Please remember to update the bash-completion script (bash/ostree) and
- * man page (man/ostree-admin-instutil.xml) when changing the option list.
- */
-
 static GOptionEntry options[] = {
   { NULL }
 };
index 3b54671136c1c16bf621a0fd38c116e4cb379bea..8bf75b31987819e23c8f712b366cd2303efecd9c 100644 (file)
@@ -173,11 +173,6 @@ selinux_relabel_dir (OstreeSePolicy                *sepolicy,
   return ret;
 }
 
-/* ATTENTION:
- * Please remember to update the bash-completion script (bash/ostree) and
- * man page (man/ostree-admin-instutil.xml) when changing the option list.
- */
-
 static GOptionEntry options[] = {
   { NULL }
 };
index 1194f82dd6dfc0e05e15869520ab865fef02c772..666e536904dd58741a69f18c03be11bad6fc071b 100644 (file)
@@ -34,11 +34,6 @@ static gboolean opt_merge;
 static char **opt_replace;
 static char **opt_append;
 
-/* ATTENTION:
- * Please remember to update the bash-completion script (bash/ostree) and
- * man page (man/ostree-admin-instutil.xml) when changing the option list.
- */
-
 static GOptionEntry options[] = {
   { "import-proc-cmdline", 0, 0, G_OPTION_ARG_NONE, &opt_proc_cmdline, "Import current /proc/cmdline", NULL },
   { "merge", 0, 0, G_OPTION_ARG_NONE, &opt_merge, "Merge with previous command line", NULL },